<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a><cite>运维管理</cite></a>
    <a><cite>系统设置</cite></a>
  </div>
</div>

<script type="text/html" template lay-url="admin/settings" lay-done="layui.data.done()">
  {{# let settings = d.data; }}
  <div class="layui-fluid layui-form">

    <div class="layui-card">
      <div class="layui-card-header">
        测试设置
      </div>
      <div class="layui-card-body">
        <div class="layui-form-item">
          <label class="layui-form-label">测试手机号</label>
          <div class="layui-input-inline" style="width: 500px">
            <textarea class="layui-textarea" lay-verify="required" class="layui-input" autocomplete="off"
                      placeholder="请输入测试手机号，多个账号使用逗号分隔"
                      name="test_mobiles">{{settings.test_mobiles || ''}}</textarea>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-footer">
            <div class="layui-input-block">
              <input type="button" lay-submit lay-filter="submit_settings" value="保存"
                     class="layui-btn">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</script>
<script>
  layui.data.done = function () {
    layui.use([], function () {
      let $ = layui.$
        , form = layui.form
        , admin = layui.admin

      // 提交
      form.on('submit(submit_settings)', function (data) {
        let field = data.field;
        admin.post('admin/settings', field, function () {
          layer.msg('保存成功', {
            offset: '15px'
            , icon: 1
            , time: 1000
          });
        });
      });
    });
  }
</script>
